package com.test.rpc;

import com.test.rpc.codec.Decoder;
import com.test.rpc.codec.Encoder;
import com.test.rpc.codec.JSONDecoder;
import com.test.rpc.codec.JSONEncoder;
import com.test.rpc.protocol.Peer;
import com.test.rpc.transport.HttpTransportClient;
import com.test.rpc.transport.TransportClient;
import lombok.Data;

import java.util.Arrays;
import java.util.List;
@Data
public class RpcClientConfig {
    //网络连接
    private Class<? extends TransportClient> transportClass = HttpTransportClient.class;
    //序列化与反序列化的信息
    private Class<? extends Encoder> encoderClass = JSONEncoder.class;
    private Class<? extends Decoder> decoderClass = JSONDecoder.class;
    //路由选择的策略信息，默认随机策略
    private Class<? extends TransportSelector> selectorClass = RandomTransportSelector.class;
    //每一个Server可以建立几个连接，默认1个
    private int connectCount = 1;
    private List<Peer> servers = Arrays.asList(new Peer("127.0.0.1", "8080"));

}
